 //评价效果
                $(".star i").live("click",function(){
                $(this).parent().find("i").removeClass("star-on");
                for(var i=0;i<=$(this).index();i++){
                $(this).parent().find("i").eq(i).addClass("star-on");
                }
            });
            
      //提交ajax
            $(".submit").live("click",function(){  
            	var $OrderId = $("#OrderId").val();
	            var $ProductId = $("#ProductId").val();
	            var $UserId = $("#UserId").val();
	            var $orderPackageId = $("#orderPackageId").val();
			   	var $ExpressEvalLevel =$(".wl").find(".star-on").size();
			   	var $ServiceEvalLevel =$(".fw").find(".star-on").size();
			   	//验证
            	if($ExpressEvalLevel==0){
            		error("请对物流评价");
            		return false;
            	}
            	if($ServiceEvalLevel==0){
            		error("请对服务评价");
            		return false;
            	}
            	var flag=true;
            	 $(".sp").each(function(){
            	 	 if($(this).find(".star-on").size()==0){
            				error("请对商品评价");
            				flag=false;
            				return false;
            		}
            	 });
            	 if($ExpressEvalLevel!=0&&$ServiceEvalLevel!=0&&flag==true){
		            	 	var orderinfo=[];
		            	//循环评价数据
		            	    $(".sp_evaluation").each(function(){
		            	   
		            	    	orderinfo.push({"OrderId":$OrderId,"orderPackageId":$orderPackageId,"ProductId":$(this).find(".ProductId").val(),"SkuId":$(this).find(".SkuId").val(),"UserId":$UserId,
		            	    		"ProductEvalLevel":$(this).find(".star-on").size(),
			            	      "ProductEvalContent":$(this).find(".pj-textarea").val(),"ExpressEvalLevel":$ExpressEvalLevel,"ServiceEvalLevel":$ServiceEvalLevel,"source":1})
		            	    })
		        			  
                    if($(".submit").hasClass("submit_success")){
                          return false;
                      }
                      $(".submit").addClass("submit_success");
		            	$.ajax({
			            	type:"post",    
			            	url:"../../evaluation/Index/addEva",
			            	datatype:"json",
			            	data:{'data':orderinfo},
			            	success:function(msg){
                                var msg = eval('(' + msg + ')');
                                if(msg.status==200){
                                    error("评价成功！");
                                    window.location.href = 'http://static.malls.tm/order/index/orderDetail?oto_order_id='+$OrderId;
                                   }else{
                                      $(".submit").removeClass("submit_success");
                                     error(msg.errormsg);
                                   }
                                }
                        
		            	})
            	 }
            	
           });
           

//评价展示页面接口ajax
var num=10;
var pageNo=1;
var count;
$(".jiazai").click(function(){
var $sku_id = $("#sku_id").val();
var $order_id = $("#order_id").val();
var offset=$(".user_evaluation .div_li").length;
pageNo++;
       $.ajax({
            type:"post",
            url:"../../evaluation/Index/getProEva",
            dataType:"json",
            data:{"skuId":$sku_id,"pageSize":num,"pageNo":pageNo,"orderId":$order_id},
            success:function(msg){
                    var boxes = [];
                    var datalength;
                    function show(){
                            datalength=msg.stdclass.list.length;
                            for (var i=0; i < datalength; i++ ){                             
     						boxes.push('<div class="div_li">'+
                       '<div class="user_details clearfix">'+
                              '<span class="touxiang fl"><img src="'+msg.stdclass.list[i].userPic+'" alt="'+msg.stdclass.list[i].nickName+'" /></span>'+
                              '<span class="user_name fl">'+msg.stdclass.list[i].nickName+'</span>'+
                              '<span class="buy_time fr">'+msg.stdclass.list[i].evaTime+'</span>'+
                        '</div>'+
                        '<p class="neirong">'+msg.stdclass.list[i].content+'</p>'+
                        '<div class="user_count">'
                           + '数量:'+msg.stdclass.list[i].amount+'份' +'购买日期:'+msg.stdclass.list[i].buyTime+
                        '</div>'+
                    '</div>');
                            }
                            return boxes.join("");
                        }
                     count=msg.stdclass.total;
                     var $boxes = $(show());
                     $(".user_evaluation").append($boxes);

                     if(msg.stdclass.list==""){
                        $(".jiazai .moreshow").remove(); 
                    }
                   offset+=5; 
        }
     }) 
   });